package com.by.service.impl;

import com.by.bean.OrderComplaint;
import com.by.bean.QueryComplaint;
import com.by.common.core.bean.PageBean;
import com.by.common.core.crud.BaseServiceImpl;
import com.by.mapper.OrderComplaintMapper;
import com.by.service.OrderComplaintService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderComplaintServiceImpl extends BaseServiceImpl<OrderComplaint, OrderComplaintMapper> implements OrderComplaintService {


    @Autowired
    OrderComplaintMapper complaintMapper;
    @Override
    public PageBean query(QueryComplaint complaint) {
        PageHelper.startPage(complaint.getPage(),complaint.getPageSize());
        List list = complaintMapper.query(complaint);
        PageInfo info = new PageInfo(list);
        return new PageBean(info.getSize(), info.getPageSize(), info.getTotal(), list);
    }
}
